# <!-- https://www.douyin.com/video/7312380369578380554 -->

import requests



session  = requests.session()

setting_url = "https://vcs.zijieapi.com/vc/setting"
batch_url = "https://mon.zijieapi.com/monitor_browser/collect/batch/?biz_id=web_bdms_cn"
bacth_header = {"Origin":
"https://m.douyin.com",
"Referer":
"https://m.douyin.com/",
"Sec-Fetch-Dest":
"empty",
"Sec-Fetch-Mode":
"cors",
"Sec-Fetch-Site":
"cross-site",
"User-Agent":
"Mozilla/5.0 (iPhone; CPU iPhone OS 16_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Mobile/15E148 Safari/604.1",}
batch_params = {"ev_type":"batch","list":[{"ev_type":"custom","payload":{"name":"sdk_glue_load","type":"event","metrics":{},"categories":{"sdk_glue_load_status":"load_success","payload_bdms_aid":"_a0","payload_bdms_page_id":"_p0"}},"common":{"context":{"ctx_bdms_aid":"_a0","ctx_bdms_page_id":"_p0"},"bid":"web_bdms_cn","pid":"/share/video/7312380369578380554","view_id":"/_1","user_id":"","session_id":"0-a-1-2-c","release":"1.0.0.47","env":"production","url":"https://m.douyin.com/share/video/7312380369578380554","timestamp":1704772276820,"sdk_version":"1.6.1","sdk_name":"SDK_SLARDAR_WEB"}}]}
batch_res = session.post(setting_url,headers=bacth_header,params=batch_params)
batch_res.encoding = 'utf-8'
print(batch_res.json())






# 获取webId
config_url = 'https://abtestvm.bytedance.com/service/2/abtest_config/'
header = {
    "Accept-Encoding":
"gzip, deflate, br",
"Accept-Language":
"zh-CN,zh;q=0.9",
# "Content-Length":
# "794",
"Content-Type":
"application/json; charset=UTF-8",
          "Origin":
"https://m.douyin.com",
"Referer":
"https://m.douyin.com/",
"Sec-Fetch-Dest":
"empty",
"Sec-Fetch-Mode":
"cors",
"Sec-Fetch-Site":
"cross-site",
"User-Agent":
"Mozilla/5.0 (iPhone; CPU iPhone OS 16_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Mobile/15E148 Safari/604.1",
         }
params = {"header":{"aid":1243,"user_unique_id":"7321925284943513097","web_id":"7321925284943513097","app_id":1243,"os_name":"ios","os_version":"16.6","device_model":"iPhone","language":"zh-CN","platform":"wap","sdk_version":"5.0.52_1","sdk_lib":"js","timezone":8,"tz_offset":-28800,"resolution":"390x844","browser":"Safari","browser_version":"16.6","referrer":"https://www.douyin.com/","referrer_host":"www.douyin.com","width":390,"height":844,"screen_width":390,"screen_height":844,"tracer_data":"{\"$utm_from_url\":1}","custom":{"$latest_referrer":"https://www.douyin.com/","$latest_referrer_host":"www.douyin.com","$latest_search_keyword":"","host_app_name":"safari","location_host":"m.douyin.com","app_type":"d"},"ab_sdk_version":"","ab_url":"https://m.douyin.com/share/video/7312380369578380554"}}
config_res = session.post(config_url,headers=header,params=params)
config_res.encoding = 'utf-8'
print(config_res.json())


# ""
# 手机号登录

# session = requests.sessions()


# https://m.douyin.com/passport/web/send_code/?aid=1243&language=zh&locale=zh&msToken=&X-Bogus=DFSzswVLxmn-h3vvt7iSmORXoR/n&_signature=_02B4Z6wo00001y8hwugAAIDCwQQGFfS7ipMvIcZAAK5fOVSg-hnpCgY35pLcOSOzBOI30ViHzDCYsNnqxO7QO3jVW2i.kj3.L2jUha7ay63Cnxa2M8KH78nCMVXB00aR6elBcXc5CIl343Lf5a
